<link href="/assets/home/css/index.css" rel="stylesheet" />

<div class="headerbox">
    <div class="header">
      <div class="headerL">
        <a onclick="location.href = '/home/index/index' " class="goback">
            <img src="/assets/home/images/logo.png" />
        </a>
      </div>
      <div class="headerC">
        <p>云课堂</p>
      </div>
      <div class="headerR">
        <a onclick="location.href = '/home/subject/search' " class="goback">
            <img src="/assets/home/images/search.png" />
        </a>
      </div>
    </div>
  </div>

<!-- 轮播 -->
<div class="mui-content" style="padding-top: 50px;">
    <div class="swiper mySwiper">
        <div class="swiper-wrapper">
            {foreach $list as $item}
            <div class="swiper-slide">
                <a href="">
                    <img src="{$item['thumbs']}">
                    <p class="mui-slider-title">{$item['title']}</p>
                </a>
            </div>
            {/foreach}
        </div>
        <div class="swiper-pagination" style="text-align: right;"></div>
    </div>
</div>

<!-- 搜索 -->
<!-- <div class="mui-input-row mui-search">
    <form onclick="location.href = '/home/subject/search' ">
        <input type="search" class="mui-input-clear" placeholder="搜索">
    </form>
</div> -->
{foreach $categoryList as $i}
<div class="mui-content">
    <h5 class="title">{$i['name']}</h5>
    <ul class="mui-table-view mui-grid-view">
        {foreach $i['subject'] as $item}
        {if $i['id']==$item['cateid']}
        <li class="mui-table-view-cell mui-media mui-col-xs-6">
            <a href="{:url('home/subject/details',['cid' => $item['id']])}">
                <div class="imgs">
                    {if !empty($item['thumbs'])}
                    <img class="mui-media-object" src="{$item['thumbs']}">
                    {else /}
                    <img class="mui-media-object" src="/assets/home/images/video.jpg">
                    {/if}
                </div>
                <div class="mui-media-body">{$item['title']}</div>
            </a>
        </li>
        {/if}
        {/foreach}
    </ul>
</div>
{/foreach}

<div class="more">没有更多了..</div>

<!-- 底部 -->
{include file="common/footer" /}

<script>
    var swiper = new Swiper(".mySwiper", {
        pagination: {
            el: ".swiper-pagination",
        },
        // 自动播放
        autoplay:{
            delay:1000,//间隔时间
            stopOnLastSlide:false,//轮播到最后一张图片是否停止（loop模式下不生效）
            disableOnInteraction:true,//当用户点击轮播图片时，是否停止轮播
        },
    });

</script>